package com.youdoneed.common.util;

import it.sauronsoftware.jave.*;

import java.io.File;

/**
 * Created by lid on 2018/1/23 0023.
 * m4a文件转mp3
 *
 */
public class M4aConvertor {
    /*public static void main(String args[]){
        Long start = System.currentTimeMillis();
        File source = new File("D:\\music\\music.m4a");
        File target = new File("D:\\music\\music.mp3");
        AudioAttributes audio = new AudioAttributes();
        audio.setCodec("libmp3lame");
        audio.setBitRate(new Integer(64000));
        audio.setChannels(new Integer(1));
        audio.setSamplingRate(new Integer(22050));
        VideoAttributes video = new VideoAttributes();
        video.setCodec("mp3");
        video.setBitRate(new Integer(160000));
        video.setFrameRate(new Integer(15));
        video.setSize(new VideoSize(400, 300));
        EncodingAttributes attrs = new EncodingAttributes();
        attrs.setFormat("mp3");
        attrs.setAudioAttributes(audio);
        attrs.setVideoAttributes(video);
        Encoder encoder = new Encoder();
        try {
            encoder.encode(source, target, attrs);
        } catch (EncoderException e) {
            e.printStackTrace();
        }

        Long end = System.currentTimeMillis();
        System.out.print(end - start);
    }*/
}
